﻿<%@ Page Title="" Language="C#"Theme = "DetailsView" MasterPageFile="~/Managers.master" AutoEventWireup="true" CodeFile="MLeaveUnleave.aspx.cs" Inherits="MLeaveUnleave" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:DetailsView 
         ID = "dtlLeave"
         SkinID = "Colorful"
         DataSourceID = "srcLeaveUnleave"
         AllowPaging = "True"
         DataKeyNames = "id"
         AutoGenerateEditButton = "True"
         AutoGenerateRows = "False"
         EmptyDataText = "没有请假的"
         HeaderText = "请假未归校的学生"
         runat = "server" EnableModelValidation="True" >
         <Fields>
         <asp:BoundField 
             DataField = "sid"
             HeaderText = "学号" ReadOnly="True" />
         <asp:BoundField 
             DataField = "sname"
             HeaderText = "姓名" 
             ReadOnly = "true"/>
         <asp:BoundField 
             DataField = "b_n"
             HeaderText = "楼房" 
             ReadOnly = "true"/>
         <asp:BoundField 
             DataField = "d_n"
             HeaderText = "宿舍号" 
             ReadOnly ="true"/>
         <asp:BoundField 
             DataField = "reasons"
             HeaderText = "原因" 
             ReadOnly = "true"/> 
         <asp:BoundField 
             DataField = "leavetime"
             HeaderText = "请假日期" 
             ReadOnly = "true"/>
         <asp:BoundField 
             DataField = "leavedays"
             HeaderText = "请假天数" 
             ReadOnly = "true"/>
         <asp:CheckBoxField 
             DataField = "leave"
             HeaderText = "是否归校" />               
         </Fields>
    </asp:DetailsView>
    <asp:SqlDataSource 
         ID = "srcLeaveUnleave"
         ConnectionString = "<%$ConnectionStrings:Dormitory %>"
         SelectCommand = "select *from leaveapplication where leave = 'false'"
         UpdateCommand = "update leaveapplication set leave =@leave where id= @id"
         runat = "server" ></asp:SqlDataSource>
</asp:Content>

